package com.homegoods.classify.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.homegoods.classify.R;
import com.homegoods.classify.model.TestBean.DatasBean.AddressListBean;
import com.kedll.library.adapter.ExpandListEntity;
import com.kedll.library.adapter.MyExpandableListAdapter;

import java.util.List;

/**
 * @author QiQi
 * @ClassName: BrandAdapter
 * @date 2018/9/9
 * @description
 */
public class BrandAdapter extends MyExpandableListAdapter<AddressListBean> {
    public BrandAdapter(Context context, List<ExpandListEntity<AddressListBean>> expandListEntities) {
        super(context, expandListEntities);
    }

    @Override
    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.expandable_listview_group, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
            holder.group.setTextSize(12f);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        String je = getChild(groupPosition, childPosition).toString();
        holder.group.setText(je);
        return convertView;
    }
}
